local ClientOHOH = _G.ClientOHOH;
local M = ClientOHOH.class.new(script, ClientOHOH.files.Client_PlayerComponent());
local CallBackManager = ClientOHOH.load.CallBackManager();
local LanguageHelper= _G.LanguageHelper
local UpdateGui=ClientOHOH.load.UIManager():CreateUI("UpdateGui",require(script.UpdateGui))


local Game_Cfg=_G.CommonOHOH.config.Game
local EventList = ClientOHOH.load.EventList();
local InstanceManager = ClientOHOH.load.InstanceManager();

--搬手腕控制

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
	self.DataBase=self.parent:GetComponent(ClientOHOH.load.Client_PlayerDataComponent());
    self.showData={}

    for _,v in pairs(Game_Cfg.Upd.tip) do
        table.insert(self.showData,LanguageHelper:GetText(v))
    end

    UpdateGui:FullData(self.showData,Game_Cfg.Upd.id)


    if self.DataBase:GetData("upd")<Game_Cfg.Upd.id then
        self:AddProcess(function()
            self:Wait(6)
            _G.ClientOHOH.load.UIManager():PushShow("UpdateGui")
            self:Fire(EventList.UpdDone)
        end)
    end

   local TouchPart= ClientOHOH:GetPath_Loop("UPD.touch",game.Workspace)
   ClientOHOH:GetPath_Loop("Attachment.BillboardGui.text",TouchPart).Text=LanguageHelper:GetText(901)

    CallBackManager:AddRbxConnect(self,TouchPart.Touched, function(obj,chPart)

        if not _G.CommonOHOH.load.GeneralTool().IsMeTouchEvent(chPart,"LeftLowerLeg") then
			return 
		end

        local p= chPart:FindFirstAncestorOfClass("Model")
        if p then
            local character = InstanceManager:FindObject(p);
            if character and character.player and character.player==self.parent then
                UpdateGui:Show()
            end
        end
    end);

end;

function M.dtor(self)


	M.super.dtor(self);
end;



return M